<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LeetCode Clone</title>
    <style>
        :root {
            --primary-color: #4CAF50;
            --secondary-color: #007bff;
            --background-color: #f4f4f4;
            --text-color: #333;
            --navbar-bg: rgba(51, 51, 51, 0.9);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
            line-height: 1.6;
            color: var(--text-color);
            background-color: var(--background-color);
            margin: 0;
            padding: 60px 0 60px 0;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .navbar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 60px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: var(--navbar-bg);
            padding: 7px 14px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            z-index: 1000;
        }

        .navbar-left, .navbar-right {
            display: flex;
            align-items: center;
        }

        .navbar a {
            color: white;
            text-decoration: none;
            font-size: 17px;
            margin: 0 13px;
            padding: 10px 15px;
            border-radius: 30px;
            transition: background-color 0.3s ease, transform 0.3s ease;
        }

        .navbar a:hover {
            background-color: var(--primary-color);
            transform: scale(1.1);
        }

        .login {
            background-color: var(--secondary-color);
        }

        main {
            flex-grow: 1;
            width: 100%;
            max-width: 1100px;
            margin: 0 auto;
            padding: 20px;
        }

        h2 {
            margin: 1rem 0 1.5rem;
            color: #1e1e1e;
            font-size: 1.5rem;
            font-weight: 500;
        }

        .problem-list {
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            
            /* table-layout: fixed; */
        }

        th, td {
            padding: 1rem;
            text-align: left;
            border-bottom: 1px solid #edf2f7;
        }

        th {
            background-color: #f8fafc;
            font-weight: 500;
            color: #64748b;
            font-size: 0.875rem;
        }

        tbody tr:hover {
            background-color: #f8fafc;
        }

        .problem-status {
            width: 15%;
        }

        .problem-id {
            width: 15%;
        }

        .problem-title {
            width: 55%;
            
        }

        .problem-star {
            width: 15%;
        }

        .status {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            display: inline-block;
            vertical-align: middle;
        }

        .status-todo { background-color: #e2e8f0; }
        .status-done { background-color: #4ade80; }

        .badge {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 1rem;
            font-size: 0.875rem;
            font-weight: 500;
            text-transform: capitalize;
        }

        .badge-easy { 
            background-color: #4ade80; 
            color: #fff; 
        }
        
        .badge-medium { 
            background-color: #22c1c3; 
            color: #fff; 
        }
        
        .badge-hard { 
            background-color: #ef4444; 
            color: #fff; 
        }

        .problem-title a {
            color: #334155;
            text-decoration: none;
            transition: color 0.2s ease;
        }

        .problem-title a:hover {
            color: #2563eb;
        }

        footer {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: var(--navbar-bg);
            color: white;
            z-index: 1000;
        }

        @media (max-width: 768px) {
            body {
                padding-top: 120px;
            }

            .navbar {
                height: auto;
                flex-direction: column;
                padding: 10px;
            }

            .navbar-left, .navbar-right {
                width: 100%;
                justify-content: space-around;
            }

            main {
                padding: 10px;
            }
        }
    </style>
</head>
<body>
    <nav class="navbar">
        <div class="navbar-left">
            <a href="/">首页</a>
            <a href="/all_questions">题库</a>
            <a href="#">竞赛</a>
            <a href="#">讨论</a>
            <a href="#">求职</a>
        </div>
        <div class="navbar-right">
            <a class="login" href="#">登录</a>
        </div>
    </nav>

    <main>
        <h2>题目列表</h2>
        <div class="problem-list">
            <table>
                <thead>
                    <tr>
                        <th>状态</th>
                        <th>编号</th> <!-- 新增编号列 -->
                        <th>题目</th>
                        <th>难度</th>
                    </tr>
                </thead>
                <tbody>
                    {{#question_list}}
                    <tr>
                        <td class="problem-status">
                            <span class="status status-{{status}}"></span>
                        </td>
                        <td class="problem-id">
                            <span>{{id}}</span>
                        </td>
                        <td class="problem-title">
                            <a href="/question/{{id}}">{{title}}</a>
                        </td>
                        <td class="problem-star">
                            <span class="badge badge-{{star}}">{{star}}</span>
                        </td>
                    </tr>
                    {{/question_list}}
                </tbody>
            </table>
        </div>
    </main>
</body>
</html>


